def solution(n,d):
    return {True:list(map(int,str(n)[-d:])),False:[]}[d>0]
def test(m,n):
	for i in range(m):
		row=[]
		for j in range(n):
			row.append(i^j)
		print(sorted(row))
